QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# 目标平台设置
target.path = /opt/$${TARGET}/bin
INSTALLS += target

# 链接 OSS SDK 库
LIBS += -L/opt/st/fsmp1a/3.1-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib \
        -lalibabacloud-oss-cpp-sdk \
        -lcurl -lssl -lcrypto -lxml2 -lpthread

# 包含头文件路径
INCLUDEPATH += /opt/st/fsmp1a/3.1-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include
DEPENDPATH += /opt/st/fsmp1a/3.1-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include

# 编译器标志（针对Cortex-A7优化）
QMAKE_CFLAGS += -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
QMAKE_CXXFLAGS += -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard

# 使用sysroot（可选，如果QT_SYSROOT已设置）
!isEmpty(QT_SYSROOT) {
    QMAKE_INCDIR += $${QT_SYSROOT}/usr/include
    QMAKE_LIBDIR += $${QT_SYSROOT}/usr/lib
}

SOURCES += \
    ImagePlayerThread.cpp \
    UdpListenerThread.cpp \
    main.cpp \
    widget.cpp

HEADERS += \
    ImagePlayerThread.h \
    UdpListenerThread.h \
    widget.h

FORMS += \
    widget.ui

# 使用默认的部署规则（删除开头的冲突配置）
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
